- 
        Couldn't load subscription status. 
- Fork 501
[CMAKE] add generated protobuf headers to the opentelemetry_proto target #3400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CMAKE] add generated protobuf headers to the opentelemetry_proto target #3400
Conversation
…t instead of using include_directories
| ✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
 | 
| Codecov ReportAll modified and coverable lines are covered by tests ✅ 
 Additional details and impacted files@@            Coverage Diff             @@
##             main    #3400      +/-   ##
==========================================
- Coverage   90.05%   90.04%   -0.01%     
==========================================
  Files         212      212              
  Lines        6932     6932              
==========================================
- Hits         6242     6241       -1     
- Misses        690      691       +1     🚀 New features to boost your workflow:
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix.
opentelemetry-proto.cmakegenerates the protobuf headers for opentelemetry-proto and includes them withinclude_directories. To propagate the headers to targets linking toopentelemetry_proto(throughopentelemetry-cpp::otlp_recordable) these headers need to be included on the target.As is, using
FetchContent_MakeAvailable(opentelemetry-cpp)withopentelemetry-cpp-contribfails here:exporters/user_events/CMakeFiles/opentelemetry_exporter_user_events_metrics.dir/src/metrics_exporter.cc.o In file included from /workspaces/opentelemetry-cpp-contrib/exporters/user_events/include/opentelemetry/exporters/user_events/metrics/exporter.h:6, from /workspaces/opentelemetry-cpp-contrib/exporters/user_events/src/metrics_exporter.cc:4: /workspaces/opentelemetry-cpp/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_metric_utils.h:14:10: fatal error: opentelemetry/proto/metrics/v1/metrics.pb.h: No such file or directory 14 | #include "opentelemetry/proto/metrics/v1/metrics.pb.h"Changes
include_directorieswithtarget_include_directoriesforGENERATED_PROTOBUF_PATHPlease provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes